from accounts import *



def find_cash(account,card_num):
    """
    查询余额
    :param account:
    :return:cash
    """
    print(account[card_num]['cash'])

def deposit(account,card_num):
    """
    存款
    :param account: 
    :param card_num: 
    :return: 
    """
    m = int(input("请输入存款金额:"))
    if m <= 0:
        print("输入金额无效")
    else:
        account[card_num]['cash'] += m
        print(f"存款成功，您的余额是{account[card_num]['cash']}")
    write_account(account)

def withdrowal(account,card_num):
    """
    取款
    :param account:
    :param card_num:
    :return:
    """
    m = int(input("请输入取款金额："))
    if m > account[card_num]['cash']:
        print("余额不足")
    elif m <= 0:
        print("输入金额无效")
    else:
        account[card_num]['cash'] -= m
        print(f"取款成功，您的余额是{account[card_num]['cash']}")
    write_account(account)